package com.systop.ltbook.order.util;
/**
 * 用于完成Double类型的计算,以避免一长串小数点后数字
 * @author Workshopers
 *
 */
public class DoubleUtils {
	public static Double roundDouble(double val, int precision) {
		Double ret = null;
		try {
			double factor = Math.pow(10, precision);
			ret = Math.floor(val * factor + 0.5) / factor;
		} catch (Exception e) {
			e.printStackTrace();
		}

		return ret;
	}
}
